pv-qemu 7/10: Async negotiation with xenfb frontend
authorKeir Fraser <keir@xensource.com>
Thu, 25 Oct 2007 13:41:35 +0000 (14:41 +0100)
committerKeir Fraser <keir@xensource.com>
Thu, 25 Oct 2007 13:41:35 +0000 (14:41 +0100)
commit0830ea747f8e64d73597a0f426c4a4c8ac6e3174
treeaca3bd64754215c893102a8d0d3bf9e44058831f
parentd9d3893da919802e8c481ef2568e3dfac338ed21
pv-qemu 7/10: Async negotiation with xenfb frontend

This patch re-factors the paravirt console xenfb_attach_dom
method. The original method blocks the caller until the front &
backends have both switched to the connected state. This isn't an
immediate problem, but patches which follow will extend qemu to also
handle the text console so blocking on graphics console startup will
block the text console processing.

The new code is basically a state machine. It starts off with a watch
waiting for the KBD backend to switch to 'initialized' mode, then does
the same for the FB backend. Now it waits for KBD & FB frontend
devices to initialize, reading & mapping the framebuffer & its config
at the appropriate step. When the KBD frontend finally reaches the
connected state it registers a graphical console with QEMU and sets up
the various framebuffer, mouse & keyboard event handlers. If a client
connects to the VNC server before this is completed, then they will
merely see a text console (or perhaps the monitor if configured that
way).

The main difference from previous versions of this patch, is that at
the suggestion of Markus Armbruster, I'vere-ordered the individual
static functions so they are in order-of-call, rather than
reversed. Although I now have to pre-declare them, it is much easier
to read the code. I have also fixed the keycode -> keysym translations
to match previous behaviour.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
tools/ioemu/hw/xen_machine_pv.c
tools/ioemu/hw/xenfb.c
tools/ioemu/hw/xenfb.h